load(key).
use_package(hypspc).
minimal_cases(2).
accuracy(0.80).
random_test_set(0.1).

classes([arch,cantilev,cont_t,simple_t,suspen,wood]).
predict(type(+example,-class)).

rmode(1:river(+Example, -R)).
rmode(1:river(+Example, #)).

rmode(1:location(+Example, -Integer)).
rmode(1:location(+Example, #)).


rmode(1:erected(+Example, -Number)).
% rmode(1:erected(+Example, #)).

rmode(1:purpose(+Example, -Purp)).
rmode(1:purpose(+Example, #)).


rmode(1:length_b(+Example, -Number)).
% rmode(1:length_b(+Example, #)).

rmode(1:lanes(+Example, -Integer)). % <--- categorical
rmode(1:lanes(+Example, #)).

rmode(1:clear_g(+Example, -Cl)).
rmode(1:clear_g(+Example, #)).

rmode(1:t_or_d(+Example, -Tod)).
rmode(1:t_or_d(+Example, #)).

rmode(1: material(+Example, -Mat)).
rmode(1: material(+Example, #)).

rmode(1: span(+Example, -Sp)).
rmode(1: span(+Example, #)).

rmode(1: rel_l(+Example, -Rel)).
rmode(1: rel_l(+Example, #)).


typed_language(yes).

type(river(example, r)).
type(location(example, integer)).
type(erected(example, number)).
type(purpose(example, purp)).
type(length_b(example, number)).
type(lanes(example, integer)). % <--- categorical
type(clear_g(example, cl)).
type(t_or_d(example, tod)).
type(material(example, mat)).
type(span(example, sp)).
type(rel_l(example, rel)).
type(number >= number).
type(number =< number).
% type(number = number).


auto_lookahead(erected(Example,Number), [Number]).
auto_lookahead(length_b(Example,Number), [Number]).


discretize(entropy).
discretization(bounds(5)).

to_be_discretized(erected(Example,Number),[Number]).
rmode(1: #(C:threshold(erected(_,Number),[Number],C),+Number >= C)).
rmode(1: #(C:threshold(erected(_,Number),[Number],C),+Number =< C)).
% rmode(1: #(C:threshold(erected(_,Number),[Number],C),+Number = C)).


to_be_discretized(length_b(Example,Number),[Number]).
rmode(1: #(C:threshold(length_b(_,Number),[Number],C),+Number >= C)).
rmode(1: #(C:threshold(length_b(_,Number),[Number],C),+Number =< C)).
% rmode(1: #(C:threshold(length_b(_,Number),[Number],C),+Number = C)).















